luci-mod-status: Remove port suffix where not applicable
authorOlli Asikainen <[email protected]>
Fri, 8 Feb 2019 14:49:04 +0000 (16:49 +0200)
committerJo-Philipp Wich <[email protected]>
Mon, 8 Apr 2019 08:18:59 +0000 (10:18 +0200)
Submitted-by: Olli Asikainen <[email protected]>
Signed-off-by: Jo-Philipp Wich <[email protected]>
modules/luci-mod-status/luasrc/view/admin_status/connections.htm

index d9099aa0780930b576545ac309d2fbc662c5adc4..e3dd39d6079ba71bc3d85a2f2ef677510dbddd6d 100644 (file)
                                                        rows.push([
                                                                c.layer3.toUpperCase(),
                                                                c.layer4.toUpperCase(),
-                                                               src + ':' + c.sport,
-                                                               dst + ':' + c.dport,
+                                                               c.hasOwnProperty('sport') ? (src + ':' + c.sport) : src,
+                                                               c.hasOwnProperty('dport') ? (dst + ':' + c.dport) : dst,
                                                                '%1024.2mB (%d <%:Pkts.%>)'.format(c.bytes, c.packets)
                                                        ]);
                                                }